﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Aleator.Core
{
    /// <summary>
    /// Concrete factory for note creation
    /// </summary>
    public class ConcreteNoteFactory : NoteFactory
    {
        /// <summary>
        /// Create a note by default
        /// </summary>
        /// <returns></returns>
        public override Note GetNote()
        {
            return new ConcreteNote();
        }

        /// <summary>
        /// Create a note for the circle of 5ths list
        /// </summary>
        /// <param name="note">Chromatic note this is based on</param>
        /// <param name="notename">Name of the note</param>
        /// <param name="noteID">Location on the MIDI keyboard</param>
        /// <param name="interval">Interval within the current scale</param>
        /// <param name="octave">Octave on the MIDI keyboard</param>
        /// <param name="adjustment" 
        /// <returns></returns>
        public override Note GetNote(CircleOfFifths.ChromaticScaleNote note, string notename, int noteID, int interval, int octave, int accidental = 0)
        {
            return new ConcreteNote(note, notename, noteID, interval, octave, accidental);
        }

        /// <summary>
        /// Create melodic (tonal) note
        /// </summary>
        /// <param name="location">Specific location within the measure this note is to be played at</param>
        /// <param name="measure">Measure this note is to be played within</param>
        /// <param name="note">Chromatic note that is the basis for this one</param>
        /// <param name="messageOnID">MIDI noteon message id</param>
        /// <param name="messageOffID">MIDI noteoff message id</param>
        /// <param name="phrase">Phrase this note is associated with</param>
        /// <param name="chord">Chord this note belongs to</param>
        /// <returns></returns>
        public override Note GetNote(int location, int measure, ConcreteNote note, int messageOnID, int messageOffID, ConcretePhrase phrase, string chord = null)
        {
            return new ConcreteNote(location, measure, note, messageOnID, messageOffID, phrase, chord);
        }

        /// <summary>
        /// Create drum note
        /// </summary>
        /// <param name="location">Specific location within the measure this note is to be played at</param>
        /// <param name="measure">Measure this note is to be played within</param>
        /// <param name="noteid">Location on the MIDI keyboard</param>
        /// <param name="messageOnID">MIDI noteon message id</param>
        /// <param name="messageOffID">MIDI noteoff message id</param>
        /// <param name="phrase">Phrase this note is associated with</param>
        /// <param name="chord">Chord this note belongs to (inapplicable for drum note)</param>
        /// <returns></returns>
        public override Note GetNote(int location, int measure, int noteid, int messageOnID, int messageOffID, ConcretePhrase phrase, string chord = null)
        {
            return new ConcreteNote(location, measure, noteid, messageOnID, messageOffID, phrase, chord);
        }
    }
}
